from django.urls import path

from apps.users import views

app_name = 'users'
urlpatterns = [
    path('register/', views.RegisterView.as_view(), name='register'),
    path('usernames/<slug:username>/count/', views.UsernameCountView.as_view(), name='username_count'),
    # 手机号校验
    path('mobiles/<slug:mobile>/count/', views.MobileCountView.as_view(), name='mobile_count'),
    # 用户登录
    path('login/', views.LoginView.as_view(), name='login'),
    # 用户信息中心
    path('info/', views.UserInfoView.as_view(), name='info'),
    # 退出登录
    path('logout/', views.LogoutView.as_view(), name='logout'),
    path('browse_histories/', views.UserBrowseHistory.as_view()),
    # 新增用户地址
    path('addresses/create/', views.AddressCreateView.as_view()),
    path('addresses/', views.AddressView.as_view(), name='address'),
    # 设置默认地址
    path('addresses/<int:address_id>/default/', views.DefaultAddressView.as_view()),
    # 修改地址标题
    path('addresses/<int:address_id>/title/', views.UpdateTitleAddressView.as_view()),
    # 修改地址与删除地址
    path('addresses/<int:address_id>/', views.UpdateDestroyAddressView.as_view()),
    path('resetpasswd/', views.ResetPasswordView.as_view(), name='resetpwd'),
]
